import { InitHttpType } from "@/types";
import { defineStore } from "pinia";
import loginHttp from "@/views/login/module/api"
import commitDetailHttp from "@/views/home/systemBrowse/commitDetail/module/api";
import aboutHttp from "@/views/about/api";
import positionManageHttp from "@/views/personnelManage/memberManage/positionManage/module/api";
import { commonHttp } from "@/api/common";
import userManageHttp from "@/views/personnelManage/userManage/userList/module/api";
import memberManageHttp from "@/views/personnelManage/memberManage/memberList/module/api";
import menuMangeHttp from "@/views/systemManage/systemPowerMange/menuManage/module/api";
import typeManageHttp from "@/views/typeManage/module/api";
import commodityManageHttp from "@/views/commodityManage/modules/api";

export type StoreApiType =
  typeof loginHttp &
  typeof commonHttp &
  typeof commitDetailHttp &
  typeof aboutHttp &
  typeof positionManageHttp &
  typeof userManageHttp &
  typeof memberManageHttp &
  typeof menuMangeHttp & 
  typeof typeManageHttp &
  typeof commodityManageHttp
 
export interface useStoreState{
  api: StoreApiType
}

export default defineStore("apiStore", {
  state: (): useStoreState => {
    return {
      api:{} as StoreApiType
    }
  },
  actions: {
    assginApi(api: useStoreState) {
      Object.assign(this.api, api)
    }
  }
})